package application.controller;

import application.anno.AutoClose;
import application.anno.Injection;
import application.anno.Layout;
import application.windows.FloatWindow;
import application.windows.UserInterface;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import lombok.Setter;
import lombok.SneakyThrows;

@Layout("TipPopup.fxml")
public class TipPopup extends UserInterface {

    @FXML
    private Label tips;

    @Injection
    private Tips tipsFloat;

    @Layout("TipPopup.fxml")
    @AutoClose
    public static class Tips extends FloatWindow {

        @Setter
        private TipPopup tipPopup;

        public TipPopup getController() {
            return this.tipPopup;
        }
    }

    public void initParam(String message) {
        tips.setText(message);
    }

    @SneakyThrows
    @Override
    @FXML
    protected void initialize() {
        super.initialize();
        this.tipsFloat.setTipPopup(this);
    }
}
